################
#PSRM: Explaining Support for Redistribution: Social Insurance Systems and Fairness
#
#Observational Analysis ESS
#Generate dataframe
#
#Verena Fetscher
#July 2022
####################

rm(list=ls())

#setwd("your/master/file/location")

sink("datafile_ESS_logr.log")

########################
#Load Packages
library("foreign")
library("MASS")

library(tidyverse)
library(zoo)

#multiple imputation
library(Amelia) ## (Version 1.8.0, built: 2021-05-26)
library(xtable)

library(Zelig)
library(sandwich)

#Set seed
set.seed(123)

source("Data_01_Income.R", echo=TRUE, max.deparse.length=Inf)
source("Data_02_TaxBenefit.R", echo=TRUE, max.deparse.length=Inf)
source("Data_03_ImmigrationStability.R", echo=TRUE, max.deparse.length=Inf) 
source("Data_04_Risk.R", echo=TRUE, max.deparse.length=Inf) 
source("Data_05_Recoding.R", echo=TRUE, max.deparse.length=Inf) 
source("Data_06_ReplacementRate.R", echo=TRUE, max.deparse.length=Inf) 
source("Data_07_OccuUnemplRate.R", echo=TRUE, max.deparse.length=Inf) 
source("Data_08_SocialSpending_Tax.R", echo=TRUE, max.deparse.length=Inf) 
source("Data_09_Missings.R", echo=TRUE, max.deparse.length=Inf) 

sink()
